#include "ConfigSection.h"


ConfigSection::ConfigSection( std::string name )
{
    m_name = name;
}

ConfigSection::~ConfigSection( void ) {}


ConfigKey& ConfigSection::operator[]( std::string key ) throw ( ConfigKeyNotFoundException )
{
    for( unsigned int i = 0; i < m_keys.size(); ++i )
    {
        if( m_keys[ i ].getName() == key )
        {
            return m_keys[ i ];
        }
    }
    throw ConfigKeyNotFoundException( key );
}

std::string ConfigSection::getName( void )
{
    return m_name;
}

void ConfigSection::addKey( ConfigKey key )
{
    m_keys.push_back( key );
}
